package com.qijian.common.utils.easyexcel.handler;

import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;

/**
 * @author gw
 */
public class ExcelStyle {
    private HorizontalCellStyleStrategy headerStyleCache;

    private static final ExcelStyle INSTANCE = new ExcelStyle();

    private ExcelStyle() {
    }

    public HorizontalCellStyleStrategy headerStyle() {
        if (headerStyleCache != null) {
            return headerStyleCache;
        }
        WriteCellStyle headWriteCellStyle = new WriteCellStyle();
        WriteFont headWriteFont = new WriteFont();
        headWriteFont.setFontHeightInPoints((short) 12);
        headWriteCellStyle.setWriteFont(headWriteFont);
        headerStyleCache = new HorizontalCellStyleStrategy(headWriteCellStyle, (WriteCellStyle) null);
        return headerStyleCache;
    }

    public static ExcelStyle getInstance() {
        return INSTANCE;
    }

}
